package com.xci.platform.auth.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.xci.platform.core.Constant;
import com.xci.platform.core.Tree;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统字典明细
 */
@EqualsAndHashCode(callSuper = false)
@Data
public class DicDetailsEntity extends Tree implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 字典明细主键
     */
    @NotBlank(message = "字典明细主键不能为空")
    @Size(min = 1, max = 50, message = "字典明细主键不能超过50个字符")
    @ExcelIgnore
    private String id;

    /**
     * 上级主键
     */
    @Size(min = 0, max = 50, message = "字典明细上级主键不能超过50个字符")
    @ExcelIgnore
    private String parentId;

    /**
     * 字典主键
     */
    @NotBlank(message = "字典主键不能为空")
    @Size(min = 1, max = 50, message = "字典主键不能超过50个字符")
    @ExcelIgnore
    private String dicId;

    /**
     * 字典编码
     */
    @Size(min = 0, max = 50, message = "字典编码不能超过50个字符")
    // @Excel(name = "字典编码")
    @ExcelIgnore
    private String dicCode;

    /**
     * 字典名称
     */
    @Size(min = 0, max = 50, message = "字典名称不能超过50个字符")
    // @Excel(name = "字典名称")
    @ExcelIgnore
    private String dicName;

    /**
     * 字典明细名称
     */
    @NotBlank(message = "字典明细名称不能为空")
    @Size(min = 1, max = 50, message = "字典明细名称简拼不能超过50个字符")
    @Excel(name = "名称")
    private String name;

    /**
     * 字典明细名称简拼
     */
    @Size(min = 0, max = 50, message = "字典明细名称简拼不能超过50个字符")
    @ExcelIgnore
    private String spell;

    /**
     * 字典明细值
     */
    @Excel(name = "值")
    private String value;

    /**
     * 启用状态
     */
    @NotNull(message = "请指定角色状态")
    @Excel(name = "状态", replace = {"启用_1", "禁用_0"})
    private Integer status;

    /**
     * 是否叶子节点
     */
    @ExcelIgnore
    private Integer leaf;

    /**
     * 排序路径
     */
    @Size(min = 0, max = 500, message = "组织机构名称简拼不能超过500个字符")
    @ExcelIgnore
    private String path;

    /**
     * 操作用户主键
     */
    @ExcelIgnore
    private String operateUserId;

    /**
     * 操作用户
     */
    @Excel(name = "操作用户")
    private String operateUserName;

    /**
     * 操作日期
     */
    @Excel(name = "操作日期", exportFormat = Constant.DefaultDateTimePattern)
    private Date operateDateTime;

    /**
     * 备注
     */
    @Size(min = 0, max = 2000, message = "备注不能超过2000个字符")
    @Excel(name = "备注")
    private String remark;
}
